package com.liang.service.impl;


import com.liang.mapper.DutyzxarmyxDAO;
import com.liang.pojo.Dutyzxarmyx;
import com.liang.service.DutyzxarmyxService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 *@作者:lsk
 *Service实现类
 *@Date:2023/10/21
*/
@Service
public class DutyzxarmyxServiceImpl implements DutyzxarmyxService{


	@Resource
	private DutyzxarmyxDAO dutyzxarmyxdao;


	/**
	根据Army_idAndDuty_id查询
	*/
	public Object selectByArmy_idAndDuty_id(Long army_id, Long duty_id){
		return dutyzxarmyxdao.selectByArmy_idAndDuty_id(army_id, duty_id);
	}


	/**
	根据Army_idAndDuty_id更新
	*/
	public Integer updateByArmy_idAndDuty_id(Dutyzxarmyx demo){
		return dutyzxarmyxdao.updateByArmy_idAndDuty_id( demo);
	}



	/**
	根据Army_idAndDuty_id删除
	*/
	public Integer deleteByArmy_idAndDuty_id(Long army_id, Long duty_id){
		return dutyzxarmyxdao.deleteByArmy_idAndDuty_id(army_id, duty_id);
	}





	/**
	 insert:(插入)
	*/
	public Object insert(Dutyzxarmyx demo){
		dutyzxarmyxdao.insertlsk(demo);
		return demo;
	}



	/**
	 insertOrUpdate(插入或更新(根据主键或唯一索引更新，主键和唯一索引不会改变))
	*/
	public Integer insertOrUpdate(Dutyzxarmyx demo){
		return dutyzxarmyxdao.insertOrUpdatelsk(demo);
	}



	/**
	 insertBath:(批量插入)
	*/
	public Integer insertBatch(List<Dutyzxarmyx> list){
		return dutyzxarmyxdao.insertBatchlsk(list);
	}



	/**
	 insertOrUpdateBatch:(批量插入或更新)
	*/
	public Integer insertOrUpdateBatch(List<Dutyzxarmyx> list){
		return dutyzxarmyxdao.insertOrUpdateBatchlsk(list);
	}



	/**
	 selectList:(根据参数查询集合)
	*/
	public List<Dutyzxarmyx> selectList(Map<String,Object> param){
		if(param.get("pageNum") != null){
			int start = Integer.parseInt(param.get("pageSize").toString()) * (Integer.parseInt(param.get("pageNum").toString()) - 1);
			param.put("pageNum",start);
		}
		return dutyzxarmyxdao.selectListlsk(param);
	}



	/**
	 selectCount:(根据集合查询数量)
	*/
	public Long selectCount(Map<String,Object> param){
		return dutyzxarmyxdao.selectCountlsk(param);
	}



}